var TournamentManagementViewModel = function(){
	var self = this;
	
           
	self.checkTournamentName = function(){
			$nameInput = $('#inputName');
			$nameInput.css('border-color','');
			
            if( $nameInput.val() ) {
	            $.get( "/tournamentManagement/checkTournamentName", { name: $nameInput.val() }, function( data ){
	                if( data.error !== undefined ){
	                    $('#error-name').html(data.error).show();
	                    $nameInput.css('border-color','#ff0039');
	                }else{
	                	$nameInput.css('border-color','#3fb618');
	                }
	            });
            }
        }
}